package com.scorpio.security.common;

import com.scorpio.security.LoginUser;
import com.scorpio.security.annotation.PersonalLogin;
import com.scorpio.security.annotation.PersonalLoginUser;
import com.scorpio.security.service.TokenService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 通用请求处理
 *
 * @author ruoyi
 */
@RestController
public class CommonController {
    private static final Logger log = LoggerFactory.getLogger(CommonController.class);

    @Autowired
    private TokenService tokenService;

    @GetMapping("login")
    public String login() {
        LoginUser loginUser = new LoginUser("66666");
        String token = tokenService.createToken(loginUser);
        tokenService.strongBackOperation(loginUser.getUniqueId(),loginUser.getToken());
        return token;
    }

}
